package com.ruoyi.common.websocket;

/**
 * 消息类型级结果
 */
public enum MsgType {

    MSG_100(100, "心跳消息"),
    MSG_200(200, "消息推送成功"),
    MSG_300(300, "消息推送失败");

    private Integer code;
    private String desc;

    MsgType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static MsgType getStatusCode(Integer code) {
        MsgType[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            MsgType unit = var1[var3];
            if (unit.getCode().equals(code)) {
                return unit;
            }
        }

        return null;
    }

    public String toString() {
        return "{code:'" + this.code + '\'' + ", message:'" + this.desc + '\'' + '}';
    }
}
